package com.zhumengquan.wozhi.controller;

import com.zhumengquan.wozhi.domain.MeetingRoom;
import com.zhumengquan.wozhi.domain.User;
import com.zhumengquan.wozhi.service.FindAllMeetingRoomService;
import com.zhumengquan.wozhi.service.FindAllUserService;
import com.zhumengquan.wozhi.service.UpdateMeetingRoomService;
import com.zhumengquan.wozhi.service.UpdateUserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class MeetingRoomController {

    @Autowired
    private FindAllMeetingRoomService find;

    @RequestMapping("/findallmeetingroom")
    @ResponseBody
    public List getSectionLoadQuota (){
        System.out.println("已查询会议室啦");
        List<MeetingRoom> result =find.getUser();
        return result;
    }


    @Autowired
    private UpdateMeetingRoomService updateMeetingRoomService;

    @RequestMapping("/updatemeetingroom")
    @ResponseBody
    public int UpdateMeetingRoom (MeetingRoom meetingRoom){
        System.out.println("已申请预定会议室啦");
        int result =updateMeetingRoomService.updateMeetingRoom(meetingRoom);
        return result;
    }
}
